#ifndef __Math__PlayManager__
#define __Math__PlayManager__

#include "cocos2d.h"
#include "ui/CocosGUI.h"
#include "../../GameConfig.h"
#include "Layers/PlayAdjustLayer.h"
#include "Layers/PlaySelectLayer.h"
#include "Layers/PlayResultLayer.h"
USING_NS_CC;
using namespace ui;

class PlayManager : public Layer
{
private:
	Size m_screenSize;
	void initBackground();
	void initLayer();
	void initGhost();
	void initGame();
	void initResult();
	void initCongratulations();
	void calculateTimePlay(Ref* pSender);
	void OpenCongratulationsLayer();
	void OpenResultLayer();
	void OpenPlaySelectLayer();
	void OpenPlayAdjustLayer();
	void ReturnLevelScene();
	

	Sprite* m_Clound;
	LoadingBar* m_loadingBar;
	PlaySelectLayer* m_PlaySelectLayer;
    PlayAdjustLayer* m_PlayAdjustLayer;
	Node* m_CongratulationsLayer;
    Node* m_ResultLayer;
	Node* m_nodeGhostPlay;
	int m_NumberResult;
	int m_currStar;

	int* m_arrGhost;
	float kSpriteWidth;
	float kSpriteHeight;
	float kPaddingWidth;
	float kPaddingHeight;
    
    EPlayType s_playType;
public:
	void update(float dt);
	void initialize();
    static EGameStatus m_EGameStatus;
	static Scene* createScene();
	virtual bool init();
	CREATE_FUNC(PlayManager);
};


#endif // __Math__PlayManager__